package com.jdz.controller.portal;

import com.jdz.common.ServerResponse;
import com.jdz.service.IProjectDetailsRaceTypeSamsaraService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("/projectdetailsraceTypesamsara")
public class ProjectDetailsRaceTypeSamsaraController {



    @Autowired
    IProjectDetailsRaceTypeSamsaraService iProjectDetailsRaceTypeSamsaraService;

    /**
     * 投票
     * @param request
     * @param projectno
     * @return
     */
    @RequestMapping(value = "ballot.do",method = RequestMethod.POST)
    @ResponseBody
    public ServerResponse ballot(HttpServletRequest request, Integer projectno) {
        return iProjectDetailsRaceTypeSamsaraService.ballot(request,projectno);
    }


    /**
     * 列出此类型所有项目->投票
     * @param racetypeno
     * @return
     */
    @RequestMapping(value = "list_racetypeno.do",method = RequestMethod.GET)
    @ResponseBody
    public ServerResponse list_racetypeno(@RequestParam(value = "racetypeno",required = true) Integer racetypeno) {
        return iProjectDetailsRaceTypeSamsaraService.list_racetypeno(racetypeno);
    }
}
